home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 428_02 / libsrc / vgetca.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-13  |  738 b   |  46 lines

  1. /*
  2. ** vgetca.c
  3. **
  4. ** Pictor, Version 1.51, Copyright (c) 1992-94 SoftCircuits
  5. ** Redistributed by permission.
  6. */
  7.  
  8. #include "pictor.h"
  9.  
  10. /*
  11. ** Returns the character/attribute from the current video position.
  12. */
  13. int vgetca(void)
  14. {
  15.     int retval;
  16.  
  17.     _asm    push    ds
  18.     _asm    mov    si,_PL_offset
  19.     _asm    cmp    _PL_snowcheck,FALSE
  20.     _asm    mov    ax,_PL_segment
  21.     _asm    mov    ds,ax
  22.     _asm    je     direct
  23.     _asm    mov    dx,CGA_STATUS_PORT
  24.     scan_lo:
  25.     _asm    in     al,dx
  26.     _asm    shr    al,1
  27.     _asm    jc     scan_lo
  28.     _asm    cli
  29.     scan_hi:
  30.     _asm    in     al,dx
  31.     _asm    shr    al,1
  32.     _asm    jnc    scan_hi
  33.     _asm    lodsw
  34.     _asm    sti
  35.     _asm    jmp    end_vgetca
  36.     direct:
  37.     _asm    lodsw
  38.     end_vgetca:
  39.     _asm    pop    ds
  40.     _asm    mov    _PL_offset,si
  41.     _asm    mov    retval,ax
  42.  
  43.     return(retval);
  44.  
  45. } /* vgetca */
  46.